package splitWords

import (
	"fmt"

	"SearchEngine/analysis/extractInformation"

	"github.com/yanyiwu/gojieba"
)

// 中文分词
func GetSplitWords() []string {
	text := <-extractInformation.Text
	fmt.Println("收到要分词的内容")
	use_hmm := true
	x := gojieba.NewJieba()
	defer x.Free()

	words := x.Cut(text, use_hmm)
	fmt.Println("分词完成")
	// fmt.Println("精确模式:", strings.Join(words, "/"))
	return words
}
